import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/repair_order_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class RepairOrderEntity {
	late int code;
	late List<RepairOrderObj> obj;
	late String msg;

	RepairOrderEntity();

	factory RepairOrderEntity.fromJson(Map<String, dynamic> json) => $RepairOrderEntityFromJson(json);

	Map<String, dynamic> toJson() => $RepairOrderEntityToJson(this);

	RepairOrderEntity copyWith({int? code, List<RepairOrderObj>? obj, String? msg}) {
		return RepairOrderEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class RepairOrderObj {
	late int id;
	late String cTime;
	late String address;
	late String fatalType;
	late int urgency;
	late int responseSpeed;
	late int serviceAttitude;
	late int constructionQuality;
	late String state;

	RepairOrderObj();

	factory RepairOrderObj.fromJson(Map<String, dynamic> json) => $RepairOrderObjFromJson(json);

	Map<String, dynamic> toJson() => $RepairOrderObjToJson(this);

	RepairOrderObj copyWith({int? id, String? cTime, String? address, String? fatalType, int? urgency, int? responseSpeed, int? serviceAttitude, int? constructionQuality, String? state}) {
		return RepairOrderObj()
			..id= id ?? this.id
			..cTime= cTime ?? this.cTime
			..address= address ?? this.address
			..fatalType= fatalType ?? this.fatalType
			..urgency= urgency ?? this.urgency
			..responseSpeed= responseSpeed ?? this.responseSpeed
			..serviceAttitude= serviceAttitude ?? this.serviceAttitude
			..constructionQuality= constructionQuality ?? this.constructionQuality
			..state= state ?? this.state;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}